package com.A21.GuoSai.demo.service_entity.entity.workflow;


import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

@Data
@ToString
@NoArgsConstructor
public class WorkFlowPojo {
    //bpmnProcessId就是flowId
    private String flowId;
    private String flowName;
    private String creator;
    private Integer usageNum;
    private Integer rightNum;
    private Integer wrongNum;
    private String flowDesc;
    private Date createDate;
    private Date changeDate;
    private String bpmn;
    private String flowImgPath;
//    @EnumValue
    private WorkFlowStatus status;

    public WorkFlowPojo(String flowId, String bpmnProcessId,Date createDate) {
        this.flowId = flowId;
        this.flowName = bpmnProcessId;
        this.createDate = createDate;
    }

    public WorkFlowPojo(String flowId, String bpmnProcessId, String flowDesc, Date createDate) {
        this(flowId,bpmnProcessId,createDate);
        this.flowDesc = flowDesc;
    }

    public void setStatus(Integer integer) {
        switch (integer) {
            case 0 :this.status=WorkFlowStatus.Designed; break;
            case 1 :this.status=WorkFlowStatus.Debugged; break;
            case 2 :this.status=WorkFlowStatus.Unpublish; break;
            case 3 :this.status=WorkFlowStatus.Published; break;
            default:
                this.status = WorkFlowStatus.Wrong;
        }
    }
}
